//
//  GetAddBuyGoodsView1.m
//  TryShopping
//
//  Created by panquanReabam.com on 16/10/22.
//  Copyright © 2016年 RuiBen. All rights reserved.
//

#import "GetAddBuyGoodsView1.h"

@implementation GetAddBuyGoodsView1
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _headImageFull = [[UIImageView alloc]init];
        [_headImageFull.layer setCornerRadius:0];
        [_headImageFull.layer setBorderWidth:0.5];
        [_headImageFull.layer setMasksToBounds:YES];
        CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
        CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){ 0.93, 0.93, 0.93, 0.93 });
        [_headImageFull.layer setBorderColor:colorref2];//边框颜色
        _headImageFull.frame = CGRectMake(15, 15, 72, 72);
        [self addSubview:_headImageFull];
        
        

        _itemName = [[UILabel alloc]init];
        _itemName.numberOfLines=0;
        _itemName.textColor=[UIColor blackColor];
        _itemName.font=[UIFont systemFontOfSize:13];
        [self addSubview:_itemName];
        
        
        _itemType = [[UILabel alloc]init];
        _itemType.font=[UIFont systemFontOfSize:12];
        _itemType.textColor=shenhuiColor;
        [self addSubview:_itemType];
        
        _dealPrice = [[UILabel alloc]init];
        _dealPrice.font=[UIFont systemFontOfSize:12];
        _dealPrice.textColor=shenhuiColor;
        [self addSubview:_dealPrice];
        
        
        _deliveryQty = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-100, 50, 85, 13)];
        _deliveryQty.font=[UIFont systemFontOfSize:12];
        _deliveryQty.textAlignment=NSTextAlignmentRight;
        _deliveryQty.textColor=shenhuiColor;
        [self addSubview:_deliveryQty];
        _quantity = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-100,75, 85, 13)];
        _quantity.font=[UIFont systemFontOfSize:12];
        _quantity.textAlignment=NSTextAlignmentRight;
        _quantity.textColor=shenhuiColor;
        [self addSubview:_quantity];
        
      
        [self setViewAutoLayout];
    }
    return self;
}
-(void)setViewAutoLayout
{
    
    [self.itemName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(99) ;
        make.right.equalTo(self.mas_right).with.offset(-10);
        make.height.equalTo(@12);
        make.top.equalTo(self.mas_top).with.offset(15);
    }];
    [self.itemType mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(97) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.mas_top).with.offset(50);
    }];
    [self.dealPrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(99) ;
        make.height.equalTo(@12);
        make.top.equalTo(self.mas_top).with.offset(75);
    }];
    
    
    
}
@end
